package at.xne.dojosui

class InitTagLib {
	static namespace = "dsui"
	//FIXME-NE note: this plugin also acts as an abstraction layour for your ui elements

	def init = {
		//FIXME-NE: First only defaults, next steps add costumization
		//includes all the required modules
		out << """
		    		<script type='text/javascript' src='${resource(dir: pluginContextPath + '/js/dojo-release-1.6.0b2/dojo',file:'dojo.js')}' djConfig='parseOnLoad:true, isDebug:true'></script>
		"""
		//output the require
		//FIXME-NE load at the end of a page
		//FIXME-NE don't load everything, load intelligent
		out << """	<script type="text/javascript">
						dojo.require("dijit.form.DateTextBox");
						dojo.require("dijit.form.TimeTextBox");
						dojo.require("dijit.form.CheckBox"); //for RadioButton
						dojo.require("dijit.form.TextBox");
						dojo.require("dijit.form.Textarea");
						dojo.require("dijit.form.FilteringSelect");
						dojo.require("dijit.form.CurrencyTextBox");
						dojo.require("dojox.image.Lightbox");
						dojo.require("dijit.MenuBar");
						dojo.require("dijit.PopupMenuBarItem");
						dojo.require("dijit.Menu");
						dojo.require("dijit.MenuItem");
						dojo.require("dijit.PopupMenuItem");
						
						dojo.require("dojo.data.ItemFileReadStore");
						dojo.require("dojox.grid.DataGrid");
						dojo.require("dojo.parser");
						
						dojo.require("dojox.widget.Toaster");
					</script>
		"""
		//include the css
		out << """
					<link rel="stylesheet" href="${resource(dir: pluginContextPath + '/js/dojo-release-1.6.0b2/dijit/themes/claro/', 	file:'claro.css')}" />
					<link rel="stylesheet" href="${resource(dir: pluginContextPath + '/js/dojo-release-1.6.0b2/dojo/resources/', 		file:'dojo.css')}" />
					<link rel="stylesheet" href="${resource(dir: pluginContextPath + '/js/dojo-release-1.6.0b2/dojox/image/resources/', file:'Lightbox.css')}" />
					<link rel="stylesheet" href="${resource(dir: pluginContextPath + '/js/dojo-release-1.6.0b2/dojox/grid/resources', 	file:'Grid.css')}" />
					<link rel="stylesheet" href="${resource(dir: pluginContextPath + '/js/dojo-release-1.6.0b2/dojox/grid/resources', 	file:'claroGrid.css')}" />
					<link rel="stylesheet" href="${resource(dir: pluginContextPath + '/js/dojo-release-1.6.0b2/dojox/widget/Toaster', 	file:'Toaster.css')}" />
		"""
	}
}
